package com.onesports.intelligent.k12.polarlight.mapper.organization;


import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.onesports.intelligent.k12.polarlight.annotation.DataPermission;
import com.onesports.intelligent.k12.polarlight.domain.dto.operation.PageOperationCampusDTO;
import com.onesports.intelligent.k12.polarlight.domain.dto.organization.CampusSearchDTO;
import com.onesports.intelligent.k12.polarlight.domain.dto.organization.PageOrganizationCampusDTO;
import com.onesports.intelligent.k12.polarlight.domain.entity.organization.OrganizationCampus;
import com.onesports.intelligent.k12.polarlight.domain.vo.operation.PageOperationCampusVO;
import com.onesports.intelligent.k12.polarlight.domain.vo.organization.CampusSearchVO;
import com.onesports.intelligent.k12.polarlight.domain.vo.organization.PageOrganizationCampusVO;
import com.onesports.intelligent.k12.polarlight.enums.DataPermissionTypeEnum;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Collection;
import java.util.List;

/**
 * ${comments}
 *
 * @author
 * @since 1.0.0 2022-07-08
 */
@Mapper
public interface OrganizationCampusMapper extends BaseMapper<OrganizationCampus> {

    /**
     * 获取校区搜索列表
     *
     * @param dto dto
     * @return {@link List}<{@link CampusSearchVO}>
     */
    List<CampusSearchVO> getCampusSearchList(@Param("dto") CampusSearchDTO dto);

    /**
     * 分页运营端查询校区分页
     *
     * @param page 分页参数
     * @param dto  入参
     * @return PageOperationCampusVO
     * @author WangCX
     */
    @DataPermission(alias = "oc")
    IPage<PageOperationCampusVO> findPage(@Param("page") Page<PageOperationCampusVO> page,
                                          @Param("dto") PageOperationCampusDTO dto);


    /**
     * 分页机构端查询校区分页
     *
     * @param page 分页参数
     * @param dto  入参
     * @return PageOrganizationCampusVO 机构端校区管理VO
     * @author WangCX
     */
    @DataPermission
    IPage<PageOrganizationCampusVO> selectOrganizationPage(@Param("page") Page<PageOrganizationCampusDTO> page,
                                                           @Param("dto") PageOrganizationCampusDTO dto);

    /**
     * 获取账户的校区名
     *
     * @param accountId
     * @return
     */
    List<String> getCampus(String accountId);

    /**
     * 获取校区
     *
     * @return
     */
    List<CampusSearchVO> getCampusList();

    /**
     * 根据区域code获取校区相关数据
     *
     * @param areaCode
     * @return
     */
    List<CampusSearchVO> getAreaCampusList(String areaCode);

    /**
     * 获取校区
     * @param campusName 校区名称
     * @param status 状态
     * @return  List<OrganizationCampus>
     */
    @DataPermission
    List<OrganizationCampus> selectCampus(@Param("campusName") String campusName, @Param("status") Boolean status);
}
